<?php

use yii\db\Schema;
use yii\db\Migration;

class m160122_092347_add_frequency_type extends Migration
{
    public function up()
    {
        $sql = <<<FINE
    truncate table {{%condition_frequency_type}};
    insert into {{%condition_frequency_type}} (type, name) values
    ('no limit', '无限制'),
    ('total', '总上限'),
    ('hour',  '每小时'),
    ('day', '每天'),
    ('week', '每周');
FINE;
        $this->execute($sql);
    }

    public function down()
    {
        return true;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
